home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////////////////////////////////////////////////////// //
- // $Id: RegInfo.hxx,v 1.2 1994/09/13 23:22:31 bmott Exp $
- /////////////////////////////////////////////////////////////////////////////// //
- // RegInfo.hxx
- //
- // This class is used by BasicCPU (and derived classes) to manage a list of
- // of register structures.
- //
- //
- // BSVC "A Microprocessor Simulation Framework"
- // Copyright (c) 1993
- // By: Bradford W. Mott
- // October 25,1993
- //
- ///////////////////////////////////////////////////////////////////////////////
- // $Log: RegInfo.hxx,v $
- // Revision 1.2 1994/09/13 23:22:31 bmott
- // Added public to class declaration of RegisterInformationNode.
- //
- // Revision 1.1 1994/02/18 19:50:09 bmott
- // Initial revision
- //
- ///////////////////////////////////////////////////////////////////////////////
-
- #ifndef REGINFO_HXX
- #define REGINFO_HXX
-
- #include "BasicCPU.hxx"
-
- ///////////////////////////////////////////////////////////////////////////////
- // RegisterInformation class declaration
- ///////////////////////////////////////////////////////////////////////////////
- class RegisterInformation {
- private:
- char *name; // The name given to the register ("D0","PC",etc)
- char *hex_value; // The value of the register in hexidecimal
- char *description; // A short description of the register
-
- public:
- RegisterInformation(const char* name, const char* hex_value,
- const char* description);
- RegisterInformation();
- ~RegisterInformation();
-
- // Set the name, hex_value, and the description fields
- void Set(const char* name, const char* hex_value, const char* description);
-
- inline const char* Name()
- { return(name); }
-
- inline const char* HexValue()
- { return(hex_value); }
-
- inline const char* Description()
- { return(description); }
- };
-
-
- ///////////////////////////////////////////////////////////////////////////////
- // RegisterInformationList class declaration
- ///////////////////////////////////////////////////////////////////////////////
- class RegisterInformationList {
- private:
- // Class for a linked list of RegisterInformation structures
- class RegisterInformationNode : public RegisterInformation {
- public:
- RegisterInformationNode* next;
-
- RegisterInformationNode(const char* name, const char* hex_value,
- const char* description)
- : RegisterInformation(name,hex_value,description),
- next((RegisterInformationNode*)0)
- { };
- };
-
- RegisterInformationNode* head; // Head of the linked list
- RegisterInformationNode* tail; // Tail of the linked list
- int number_of_elements; // Number of elements in the list
-
- public:
- RegisterInformationList(BasicCPU*);
- ~RegisterInformationList();
-
- // Append an element to the end of the list
- void Append(const char* name,const char* hex_value,const char* description);
-
- // Return the number of elements in the list
- inline int NumberOfElements()
- { return(number_of_elements); }
-
- // Get the element with the given index (return 1=OK,0=ERROR)
- int Element(int,RegisterInformation&);
- };
- #endif
-